Python Programming by Russel John
A local variable that is implicitly typed whose type is going to be inferred by the computer from the expression on its right is going to be useful when you would like to deal with the language-integrated queries. These are going to be the types of queries that will return to us some anonymous types in creating a custom type for each of the sets of results that you have.
The memory allocation that you are going to find with this kind of a variable is often going to be based on the type of variable that you are working with. If you are working with something like an integer or a structure, then the entirety of the contents will be stored in a stack. But if you are using a reference type of variable, it is going to be placed in the reference portion of the stack and the contents will be in the heap that goes with it.